package com.heima.wemedia.controller.v1;

import com.heima.model.comment.dtos.CommentManageDto;
import com.heima.model.comment.dtos.CommentPageDto;
import com.heima.model.comment.dtos.StatusCommentDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmCommentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/comment/manage")
@Slf4j
public class WmCommentController {

    @Autowired
    private WmCommentService wmCommentService;

    @PostMapping("/find_news_comments")
    public ResponseResult showListComment(@RequestBody CommentPageDto dto){

        return wmCommentService.showListComment(dto);

    }
    @PostMapping("/update_comment_status")
    public ResponseResult  updateStatusComment(@RequestBody StatusCommentDto dto){
        return wmCommentService.updateStatusComment(dto);
    }
    @PostMapping("/list")
    public ResponseResult  listComment(@RequestBody CommentManageDto dto){
        return wmCommentService.listComment(dto);
    }
}
